1. Field of the Invention
This invention relates to the field of computer displays, and in particular, to the creation and display of windows on a computer display.
2. Background Art
In a multi-tasking environment, a plurality of computer programs, such as application programs (hereinafter referred to as "programs") can be used simultaneously by a computer user. Each program may have one or more associated windows for receiving display data. Each window and its associated display data is displayed on a display device, such as a video or liquid crystal display (LCD). The user may enter commands and interact with a program by manipulating data or images in a window or by selecting operations from a menu associated with the window or associated program, using input devices such as a mouse, keyboard, etc.
In response to user inputs or other operations, a program updates or changes its display information. The process by which a program provides display information to a screen display is known as "drawing" to a window or "writing to" a window. A display window can overlap other windows, partially or completely obscuring the windows beneath it. One window or set of windows is typically the "active window" and most user interaction is with this active window.
A controller is used to monitor window size, position and status (active or non-active). This controller, often referred to as a window server, acts as an interface between a program and a display screen.
A block diagram of a computer system having a window server is illustrated in FIG. 1. A plurality of programs 10A-10N provide drawing commands on lines 11A-11N to window server 12. Each application draws into its associated windows. The window server 12 determines the display information that is actually visible based on the window position and hierarchy and provides output on line 13 to frame buffer 14. Frame buffer 14 stores the pixel representation of the display screen. Frame buffer 14 provides display information on line 15 to display screen 16. The contents of frame buffer 14 are then displayed on display 16.
Depending on the display output requirements of an individual program, one of three window types can be implemented. These types are referred to as "non-retained" windows, "retained" windows and "buffered" windows. Examples of these types or windows are illustrated in FIGS. 2-4.
NON-RETAINED WINDOWS
FIG. 2 illustrates a non-retained window scheme. Two windows, A and B, are defined on display screen 16. Window B is the topmost "active" window and partially obscures window A, so that window A is divided into two areas, a visible region 17 and a non-visible region 18 (indicated by a dashed line). When program A writes to window A, it writes to the entire window, both visible and non-visible regions. The window server draws to the screen only the display information in visible region 17. The portion in non-visible portion 18 is discarded. If window A is moved or becomes the active window, the region 18 of window A is blank. Therefore, the program A must be called to redraw the window in the newly visible regions. In a multi-tasking system that uses virtual memory, significant delays can result in a non-retained window scheme. This is because an application may not currently reside in physical memory and must be paged into physical memory from secondary storage to operate. Paging is a relatively slow operation, resulting in delays in drawing to the screen.
RETAINED WINDOWS
A retained window scheme, such as illustrated in FIG. 3, provides a solution to delays resulting from paging. In the example shown, window A is again partially obscured by window B so that window A has a visible region 17 and a non-visible obscured region 18. In a retained window scheme, a buffer 19, (also referred to as a "backing store") is provided for each window. The window server draws the visible portion 17 of window A onto the display screen 16 and draws the obscured region 18 into the backing store buffer 19. If some or all of region 18 becomes visible, the information associated with the uncovered portion is copied from backing store 19 to screen display 16. This can be accomplished without calling program A so that paging delays are avoided. If additional portions of window A become obscured, a copy of those additional portions is made from the frame buffer and provided to the backing store buffer 19. The backing store 19 is equal to the size of the window since all of the window may be obscured at one time or another.
BUFFERED WINDOWS
In the non-retained and retained windowing schemes of FIGS. 2 and 3, drawing of display data is done directly to the screen display 16. In the buffered window scheme of FIG. 4, drawing is done to backing store buffer 19. The backing store buffer is the same size as its associated window. All drawing is done in the backing store buffer 19 and those portions that are visible and modified are then copied to the screen display 16. For example, window A is drawn entirely in backing store buffer 19 and only the visible region 17 is then copied to the screen display 16. A buffered window scheme is particularly useful in graphic applications where the process of drawing is relatively time consuming. By using the buffer, a user sees only the finished drawing, and not the drawing process itself.
The backing store buffers are typically implemented in the main memory of the processor associated with the resident computer system.
A disadvantage of prior art computer systems that implement retained and buffered window schemes is an inefficient use of memory. In such schemes, for each display window, a backing store buffer is provided that is the same size, in terms of memory, as the display window. The total amount of memory required for each display window and each backing store buffer is dependent on the "depth" of the frame buffer.
To understand the depth of a frame buffer, first consider a computer display. A display screen is comprised of an array of picture elements (pixels). Each pixel is a discrete point on the display. Images are produced on a display screen by "turning on" selected pixels. Thus, display images may be comprised, for example, of a plurality of small points of light that, when viewed from a distance, combine to form an image. The resolution of the image of the display in that example is dependent on the number of brightness or color levels that each pixel can represent. This, in turn, is dependent on the depth of the frame buffer.
Each pixel is represented in the frame buffer memory by one or more bits. The resolution of the display image is dependent on the number of bits representing each pixel in the frame buffer. The bits per pixel depth of a frame buffer is constant and depends on the amount of memory provided for the frame buffer.
If only one bit is provided for each pixel in the frame buffer, each pixel can assume one of only two values, on or off (black or white). Thus, a one bit per pixel system is a monochromatic system. Shading of a single pixel is not possible in a monochromatic display system. If a plurality of bits are provided for each pixel in a frame buffer, it becomes possible for pixels to assume intermediate levels. For example, if the frame buffer provides two bits per pixel, four levels of brightness can be defined; off (00), a first level of brightness (01), a second level of brightness (10) and full on (11). By providing more bits per pixel in the frame buffer, more levels of gray can be represented and displayed.
Color images can be achieved on a computer display by providing pixels that can represent primary colors (red, green, and blue). To display high resolution color images, a greater number of bits per pixel is required. Many color display systems provide 24 bits per pixel depth frame buffers. The eight most significant bits represent the intensity of the red contribution to the display pixel, the next eight most significant bits represent the intensity of the green contribution, and the eight least significant bits represent the blue contribution. Thus, 256 levels each of red, green, and blue can be defined in a 24 bit per pixel system with a total of over sixteen million possible colors of the display pixel.
In prior art systems, the depth of the frame buffer controls the depth of the backing store buffers. That is, if the frame buffer is 24 bits per pixel, then the backing stores are 24 bits per pixel as well. This leads to inefficiencies in memory usage. For example, many programs require only one or two bits per pixel resolution of the display image. Assigning 24 bits per pixel to the backing stores of these programs is unnecessary and wastes memory.
It is an object of the present invention to provide a method of defining backing store buffers which is independent of the depth of an associated frame buffer.
It is also an object of the present invention to provide a method of defining backing store buffers where the depth of the backing store buffer is configured automatically.
It is yet another object of the present invention to provide a method of defining backing store buffers that is implemented at a system level.
It is yet another object of the present invention to provide a method of automatically selecting the depth of a window backing store that requires the least allocation of memory resources, based on the drawing requirements of a program drawing to the window.